﻿<Window x:Class="Veralkohol.OpenServer"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
        xmlns:mvvm="http://www.galasoft.ch/mvvmlight"
        Title="Távoli megnyitás" Height="500" Width="500"
        DataContext="{Binding OpenVM, Source={StaticResource VML}}">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="30" />
            <RowDefinition Height="*" />
            <RowDefinition Height="30" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="100" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        
        <Rectangle Fill="Gray" Grid.ColumnSpan="2" />
        <TextBlock Text="?" FontFamily="Ubuntu" FontWeight="Bold" FontSize="30" Grid.ColumnSpan="2" 
                   HorizontalAlignment="Right" Margin="0,0,10,0" Foreground="WhiteSmoke" VerticalAlignment="Center">
            <ToolTipService.ToolTip>
                <TextBlock>
                    Válaszd ki a megnyitni kívánt időpontot!
                </TextBlock>
            </ToolTipService.ToolTip>
        </TextBlock>

        <Rectangle Fill="Gray" Grid.ColumnSpan="2" Grid.Row="2" />
        <StackPanel Grid.ColumnSpan="2" Grid.Row="2" HorizontalAlignment="Right" Orientation="Horizontal">
            <Button Content="Megnyitás" Width="100" Margin="3" Command="{Binding Open}"/>
            <Button Content="Mégse" Width="100" Margin="3" Command="{Binding Cancel}"/>
        </StackPanel>
        
        <Image Source="Images/server.jpg" Grid.Row="1" />
        <ScrollViewer Grid.Column="1" Grid.Row="1">
            <ListBox ItemsSource="{Binding Files}">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="10" />
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <Image Source="Images/remote.jpg" />
                            <TextBlock Grid.Column="2" Text="{Binding date}" FontFamily="Ubuntu" FontWeight="Bold" />
                        </Grid>
                    </DataTemplate>
                </ListBox.ItemTemplate>

                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="SelectionChanged">
                        <mvvm:EventToCommand Command="{Binding SelectionChanged}" PassEventArgsToCommand="True" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </ListBox>
        </ScrollViewer>
    </Grid>
</Window>
